@Onyx said in The Return of the view raw button:
I don't think it is, not automatically anyway, and I can't find how they register them.
It appears to be here... of course, it's minified...
function l(t) {
var e = n.get('topic');
e.on('click', '[component="post/quote"]', function () {
f($(this), t)
});
e.on('click', '[component="post/reply"]', function () {
u($(this), t)
});
$('.topic').on('click', '[component="topic/reply"]', function () {
u($(this), t)
});
$('.topic').on('click', '[component="topic/reply-as-topic"]', function () {
i.translate('[[topic:link_back, ' + ajaxify.data.titleRaw + ', ' + config.relative_path + '/topic/' + ajaxify.data.slug + ']]', function (t) {
$(window).trigger('action:composer.topic.new', {
cid: ajaxify.data.cid,
body: t
})
})
});
e.on('click', '[component="post/favourite"]', function () {
p($(this), m($(this), 'data-pid'))
});
e.on('click', '[component="post/upvote"]', function () {
return d($(this), '.upvoted', 'posts.upvote')
});
e.on('click', '[component="post/downvote"]', function () {
return d($(this), '.downvoted', 'posts.downvote')
});
e.on('click', '[component="post/vote-count"]', function () {
h(m($(this), 'data-pid'))
});
e.on('click', '[component="post/flag"]', function () {
var t = m($(this), 'data-pid');
require(['forum/topic/flag'], function (e) {
e.showFlagModal(t)
})
});
e.on('click', '[component="post/edit"]', function () {
var t = $(this);
$(window).trigger('action:composer.post.edit', {
pid: m(t, 'data-pid')
})
});
e.on('click', '[component="post/delete"]', function () {
v($(this), t)
});
e.on('click', '[component="post/restore"]', function () {
v($(this), t)
});
e.on('click', '[component="post/purge"]', function () {
y($(this), t)
});
e.on('click', '[component="post/move"]', function () {
w($(this))
});
e.on('click', '[component="post/chat"]', function () {
C($(this))
})
}
@Onyx said in The Return of the view raw button:
Should I switch to getting the raw on click rather than shipping it with posts?
Probably.
@Onyx said in The Return of the view raw button:
I have to handle edits anyway
I set a mutation observer to watch the post and either throw away the cached raw if it's hidden, or update it if it's not hidden.
@Onyx said in The Return of the view raw button:
Should I pad/shorten the <pre> element height to avoid any weird adjustments?
No... I don't think so. Although in some cases it might make sense to scroll the top of the post back into view.